<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>添加相册</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    </head>
    <body>
      <!-- 导航条-->
		<nav class="navbar navbar-inverse">
		  <div class="container-fluid">
		  <div class="navbar-header">
		      <a class="navbar-brand" href="./photo.php">
		        <img alt="在线相册" src="...">
		      </a>
		  </div>
		  </div>
		</nav>

		    <!-- 主体内容-->
  

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>




<?php 
$id=$_GET['id'];

//第一步连接数据库服务器；
@mysql_connect('localhost','root','root');
//第二步判断是否正确连接；
if (mysql_errno()) {
    die(mysql_error());

}
//第三步选择数据库
 mysql_select_db('photo');
//第四步设置字符集
 mysql_set_charset('utf8');
 $sql ="delete from `photo` where id={$id}";

 $res =mysql_query($sql);

  if ($res){
     echo "<script>
     alert('删除成功');window.location.href='photo.php'</script>";
 }else{
    echo "<script>
     alert('删除失败');window.location.href='photo.php'</script>";
 }









 ?>